﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="GroupInput.ascx.cs" Inherits="admin_webparts_Plug_ins_HighlightLink_GroupInput" %>
<%@ Import Namespace="NTTHAO.CommonWeb" %>
<%@ Import Namespace="NTTHAO.Web.BL.HighlightLink" %>
<div class="tip">
    <h1 style="left: 0px; position: relative;">Nhập thông tin nhóm liên kết mở rộng</h1>
    <div style="display: block; width: 32px; height: 32px; float: right; position: relative; top: -27px;"><a title="<%=LanguageUtility.GetLanguageText("CLICK_RETURN", Session) %>" href="?type=<%=Request.QueryString["type"] %>&name=<%=Request.QueryString["name"] %>"><img src="resources/images/Back.png" alt="" /></a></div>
</div>
<form id="aspnetForm" runat="server" method="post" onsubmit="return NTTHAO.formValidator.onFormSubmit();">
<p>
    <span id="spSave" class="yui-button yui-link-button yuibtn yuibtn-icon btnsave"><span class="first-child"><input id="btnSave" type="submit" value="Save" runat="server" onserverclick="btnSave_Click" /></span></span>
    <span id="spCancel" class="yui-button yui-link-button yuibtn yuibtn-icon btncancel"><span class="first-child"><a href="?type=<%=Request.QueryString["type"] %>&name=<%=Request.QueryString["name"] %>" tabindex="0"><%=LanguageUtility.GetLanguageText("CANCEL", Session)%></a></span></span>
</p><%if (_ErrorMsg != string.Empty) { %>
<div class="tip" style="margin-top: 10px;color: Red;background-color: moccasin;"><%=_ErrorMsg %></div><%} %>
<script type="text/javascript">
    YAHOO.util.Event.onContentReady('spSave', function () {
        var spSave = new YAHOO.widget.Button("spSave");
    });
    YAHOO.util.Event.onContentReady('spCancel', function () {
        var spCancel = new YAHOO.widget.Button("spCancel");
    });
    
    function changeImageAvailable(available) {
        if (available) {
            //document.getElementById('imgAv0').style.display = '';
            document.getElementById('imgAv1').style.display = '';
            document.getElementById('imgAv2').style.display = '';
            document.getElementById('imgAv7').style.display = '';
            document.getElementById('imgAv8').style.display = '';
            changeAutoResize(document.getElementById('<%=chkAutoResize.ClientID %>').checked);
            changeThumbOption(document.getElementById('<%=cmbThumbImageOption.ClientID %>').value);
        } else {
            //document.getElementById('imgAv0').style.display = 'none';
            document.getElementById('imgAv1').style.display = 'none';
            document.getElementById('imgAv2').style.display = 'none';
            document.getElementById('imgAv3').style.display = 'none';
            document.getElementById('imgAv4').style.display = 'none';
            document.getElementById('imgAv5').style.display = 'none';
            document.getElementById('imgAv6').style.display = 'none';
            document.getElementById('imgAv7').style.display = 'none';
            document.getElementById('imgAv8').style.display = 'none';
            document.getElementById('imgAv9').style.display = 'none';
            document.getElementById('imgAv10').style.display = 'none';
            document.getElementById('imgAv11').style.display = 'none';
            document.getElementById('imgAv12').style.display = 'none';
        }
    }
    function changeAutoResize(auto) {
        if (auto) {
            document.getElementById('imgAv3').style.display = '';
            document.getElementById('imgAv4').style.display = '';
            document.getElementById('imgAv5').style.display = '';
            document.getElementById('imgAv6').style.display = '';
        } else {
            document.getElementById('imgAv3').style.display = 'none';
            document.getElementById('imgAv4').style.display = 'none';
            document.getElementById('imgAv5').style.display = 'none';
            document.getElementById('imgAv6').style.display = 'none';
        }
    }
    function changeThumbOption(value) {
        if (value == '0') {
            //document.getElementById('imgAv7').style.display = 'none';
            //document.getElementById('imgAv8').style.display = 'none';
            document.getElementById('imgAv9').style.display = 'none';
            document.getElementById('imgAv10').style.display = 'none';
            document.getElementById('imgAv11').style.display = 'none';
            document.getElementById('imgAv12').style.display = 'none';
        } else {
            //document.getElementById('imgAv7').style.display = '';
            //document.getElementById('imgAv8').style.display = '';
            document.getElementById('imgAv9').style.display = '';
            document.getElementById('imgAv10').style.display = '';
            document.getElementById('imgAv11').style.display = '';
            document.getElementById('imgAv12').style.display = '';
        } 
    }
    function changePriceAvailable(available) {
        if (available) {
            document.getElementById('priceAv1').style.display = '';
            document.getElementById('priceAv2').style.display = '';
            document.getElementById('priceAv3').style.display = '';
            changeCurrencyAvailable(document.getElementById('<%=chkCurrencyAvailable.ClientID %>').checked);
        } else {
            document.getElementById('priceAv1').style.display = 'none';
            document.getElementById('priceAv2').style.display = 'none';
            document.getElementById('priceAv3').style.display = 'none';
            document.getElementById('priceAv4').style.display = 'none';
        }
    }
    
    function changeCurrencyAvailable(available) {
        if (available) {
            document.getElementById('priceAv4').style.display = '';
        } else {
            document.getElementById('priceAv4').style.display = 'none';
        }
    }
    
YAHOO.util.Event.onDOMReady(function() {
    changeImageAvailable(document.getElementById('<%=chkImageAvailable.ClientID %>').checked);
    changePriceAvailable(document.getElementById('<%=chkPriceAvailable.ClientID %>').checked);
    document.getElementById('<%=txtName.ClientID %>').focus();
    
    var tbInput = document.getElementById('tbInput');
    for(var i = 0; i < tbInput.rows.length; i++) {
        tbInput.rows[i].setAttribute('class', i%2==0?'even':'odd');
    }
});
</script>
<table width="100%" cellspacing="1" cellpadding="3" border="1" style="margin-top: 10px;" class="grid" id="tbInput">
    <tr>
        <td width="150px" align="right"><%=LanguageUtility.GetLanguageText("NAME", Session) %>:</td>
        <td><asp:TextBox ID="txtName" runat="server" Width="500px"></asp:TextBox></td>
    </tr>
    <tr>
        <td width="150px" align="right"><%=LanguageUtility.GetLanguageText("HLINK_LIMIT", Session)%>:</td>
        <td><asp:TextBox ID="txtMaxItemCount" runat="server" Width="50px">-1</asp:TextBox>
            &nbsp;<div style="color: mediumblue; background-color: moccasin; padding: 3px 10px 3px 10px; display: inline;">-1: không giới hạn</div></td>
    </tr>
    <tr><td colspan="2">&nbsp;</td></tr>
    <tr id="imgAv0">
        <td align="right">Hình ảnh:</td>
        <td>
            <asp:CheckBox ID="chkImageAvailable" runat="server" Text="Có hình" Checked="false" onclick="return changeImageAvailable(this.checked);"  />&nbsp;&nbsp;<span id="imgAv0" style="color: #ff0000;"><asp:CheckBox ID="chkImageRequired" runat="server" Text="Bắt buộc" Checked="false" /></span>
        </td>
    </tr>
    <tr id="imgAv1">
        <td align="right"><%=LanguageUtility.GetLanguageText("DEFAULT_SIZE", Session)%>:</td>
        <td>
            <asp:TextBox ID="txtDefaultWidth" runat="server" Width="50px">800</asp:TextBox> x <asp:TextBox ID="txtDefaultHeight" runat="server" Width="50px">600</asp:TextBox> pixels
        </td>
    </tr>
    <tr id="imgAv2">
        <td align="right">Tự động resize:</td>
        <td><asp:CheckBox ID="chkAutoResize" runat="server" Text="Tự động resize" Checked="false" onclick="return changeAutoResize(this.checked);" /></td>
    </tr>
    <tr id="imgAv3">
        <td align="right">Kích thước ảnh resize:</td>
        <td>
            <asp:TextBox ID="txtResizeWidth" runat="server" Width="50px">800</asp:TextBox> x <asp:TextBox ID="txtResizeHeight" runat="server" Width="50px">600</asp:TextBox> pixels
        </td>
    </tr>
    <tr id="imgAv4">
        <td align="right">Cách resize:</td>
        <td>
            <select id="cmbResizeOption" runat="server" style="width: 150px;">
                <option value="1">FillTopLeft</option>
                <option value="2">FillCenter</option>
                <option value="3">FillBottomRight</option>
                <option value="4">FitWidth</option>
                <option value="5">FitHeight</option>
                <option value="6">AutoFix</option>
                <option value="7">CenterCanvas</option>
                <option value="8">Stretch</option>
                <option value="9">Tile</option>
                <option value="10">Center</option>
                <option value="11" selected="selected">MaximumSizeFix</option>
            </select>
        </td>
    </tr>
    <tr id="imgAv5">
        <td align="right">Màu nền:</td>
        <td>
            <b>#</b><asp:TextBox ID="txtResizeBackColor" runat="server" Width="137px" Text="FFFFFF" MaxLength="6"></asp:TextBox>
        </td>
    </tr>
    <tr id="imgAv6">
        <td align="right">Chất lượng ảnh:</td>
        <td>
            <select id="cmbImageQuantity" runat="server" style="width: 150px;">
                <option value="90">Trung bình (90%)</option>
                <option value="95" selected="selected">Tốt (95%)</option>
                <option value="100">Rất tốt (100%)</option>
            </select>
        </td>
    </tr>
    <tr id="imgAv7"><td colspan="2">&nbsp;</td></tr>
    <tr id="imgAv8">
        <td align="right">Hình nhỏ:</td>
        <td>
            <select id="cmbThumbImageOption" runat="server" style="width: 150px;" onchange="return changeThumbOption(this.value);">
                <option value="0" selected="selected">Không có</option>
                <option value="1">Yêu cầu upload</option>
                <option value="2">Tự resize hình lớn</option>
            </select>
        </td>
    </tr>
    <tr id="imgAv9">
        <td align="right">Kích thước hình nhỏ:</td>
        <td>
            <asp:TextBox ID="txtThumbWidth" runat="server" Width="50px">80</asp:TextBox> x <asp:TextBox ID="txtThumbHeight" runat="server" Width="50px">60</asp:TextBox> pixels
        </td>
    </tr>
    <tr id="imgAv10">
        <td align="right">Cách resize hình nhỏ:</td>
        <td>
            <select id="cmbThumbResizeOption" runat="server" style="width: 150px;">
                <option value="1">FillTopLeft</option>
                <option value="2">FillCenter</option>
                <option value="3">FillBottomRight</option>
                <option value="4">FitWidth</option>
                <option value="5">FitHeight</option>
                <option value="6">AutoFix</option>
                <option value="7">CenterCanvas</option>
                <option value="8">Stretch</option>
                <option value="9">Tile</option>
                <option value="10">Center</option>
                <option value="11" selected="selected">MaximumSizeFix</option>
            </select>
        </td>
    </tr>
    <tr id="imgAv11">
        <td align="right">Màu nền hình nhỏ:</td>
        <td>
            <b>#</b><asp:TextBox ID="txtThumbBackColor" runat="server" Width="137px" Text="FFFFFF" MaxLength="6"></asp:TextBox>
        </td>
    </tr>
    <tr id="imgAv12">
        <td align="right">Chất lượng hình nhỏ:</td>
        <td>
            <select id="cmbThumbQuantity" runat="server" style="width: 150px;">
                <option value="90">Trung bình (90%)</option>
                <option value="95" selected="selected">Tốt (95%)</option>
                <option value="100">Rất tốt (100%)</option>
            </select>
        </td>
    </tr>
    <tr><td colspan="2">&nbsp;</td></tr>
    <tr>
        <td align="right">Mô tả:</td>
        <td>
            <select id="cmbDescriptionOption" runat="server" style="width: 150px;">
                <option value="0" selected="selected">Không có</option>
                <option value="1">Mô tả ngắn</option>
                <option value="2">Mô tả dài</option>
            </select>
        </td>
    </tr>
    <tr>
        <td align="right">File css:</td>
        <td><asp:TextBox ID="txtCssUrl" runat="server" Width="500px" Text="#"></asp:TextBox></td>
    </tr>
    <tr><td colspan="2">&nbsp;</td></tr>
    <tr>
        <td align="right">Hiển thị giá:</td>
        <td><asp:CheckBox ID="chkPriceAvailable" runat="server" Text="Hiển thị giá" Checked="false" onclick="return changePriceAvailable(this.checked);" /></td>
    </tr>
    <tr id="priceAv1">
        <td align="right">Hiển thị giảm giá:</td>
        <td><asp:CheckBox ID="chkSaleOffAvailable" runat="server" Text="Hiển thị giảm giá" Checked="false" /></td>
    </tr>
    <tr id="priceAv2">
        <td align="right">Hiển thị đơn vị tính:</td>
        <td><asp:CheckBox ID="chkUnitAvailable" runat="server" Text="Hiển thị đơn vị tính" Checked="false" /></td>
    </tr>
    <tr id="priceAv3">
        <td align="right">Hiển thị đơn vị tiền tệ:</td>
        <td><asp:CheckBox ID="chkCurrencyAvailable" runat="server" Text="Hiển thị đơn vị tiền tệ" Checked="false" onclick="return changeCurrencyAvailable(this.checked);" /></td>
    </tr>
    <tr id="priceAv4">
        <td align="right">Đơn vị tiền tệ mặc định:</td>
        <td><asp:TextBox ID="txtCurrencyDefault" runat="server" Width="100px" Text="VNĐ" MaxLength="6"></asp:TextBox></td>
    </tr>
    <tr><td colspan="2">&nbsp;</td></tr>
    <tr>
        <td align="right"><%=LanguageUtility.GetLanguageText("ACTIVE", Session) %>:</td>
        <td><asp:CheckBox ID="chkActive" runat="server" Text="Active" Checked="true" /></td>
    </tr>
</table>
<p style="text-align: left; margin-top: 10px;">
    <span id="spSave2" class="yui-button yui-link-button yuibtn yuibtn-icon btnsave"><span class="first-child"><input id="btnSave2" type="submit" value="Save" runat="server" onserverclick="btnSave_Click" /></span></span>
    <span id="spCancel2" class="yui-button yui-link-button yuibtn yuibtn-icon btncancel"><span class="first-child"><a href="?type=<%=Request.QueryString["type"] %>&name=<%=Request.QueryString["name"] %>"><%=LanguageUtility.GetLanguageText("CANCEL", Session)%></a></span></span>
</p>
<script type="text/javascript">
    YAHOO.util.Event.onContentReady('spSave2', function () {
        var spSave2 = new YAHOO.widget.Button("spSave2");
    });
    YAHOO.util.Event.onContentReady('spCancel2', function () {
        var spCancel2 = new YAHOO.widget.Button("spCancel2");
    });
</script>
</form>